# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Content.V21.Model.BuiltInSimpleAction do
  @moduledoc """
  Action that is implemented and performed in (your) third-party application. Represents various functionality that is expected to be available to merchant and will help them with resolving the issue. The application should point the merchant to the place, where they can access the corresponding functionality. If the functionality is not supported, it is recommended to explain the situation to merchant and provide them with instructions how to solve the issue.

  ## Attributes

  *   `additionalContent` (*type:* `GoogleApi.Content.V21.Model.BuiltInSimpleActionAdditionalContent.t`, *default:* `nil`) - Long text from an external source that should be available to the merchant. Present when the type is `SHOW_ADDITIONAL_CONTENT`.
  *   `attributeCode` (*type:* `String.t`, *default:* `nil`) - The attribute that needs to be updated. Present when the type is `EDIT_ITEM_ATTRIBUTE`. This field contains a code for attribute, represented in snake_case. You can find a list of product's attributes, with their codes [here](https://support.google.com/merchants/answer/7052112).
  *   `type` (*type:* `String.t`, *default:* `nil`) - The type of action that represents a functionality that is expected to be available in third-party application.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :additionalContent =>
            GoogleApi.Content.V21.Model.BuiltInSimpleActionAdditionalContent.t() | nil,
          :attributeCode => String.t() | nil,
          :type => String.t() | nil
        }

  field(:additionalContent, as: GoogleApi.Content.V21.Model.BuiltInSimpleActionAdditionalContent)
  field(:attributeCode)
  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.Content.V21.Model.BuiltInSimpleAction do
  def decode(value, options) do
    GoogleApi.Content.V21.Model.BuiltInSimpleAction.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Content.V21.Model.BuiltInSimpleAction do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
